#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>

double function(int n)
{
	if (n == 1)
	{
		return 1;
	}
	return (1 / (1 + function(n - 1)));
}

int main(){
	int num = 0;
	scanf("%d", &num);
	double n = function(num);
	printf("%.6lf\n", n);

	return 0;
}


